package com.lyf.scm.plan.config;

import cn.hutool.core.date.DateUtil;
import com.lyf.scm.plan.domain.util.BigDataCacheUtil;
import org.springframework.stereotype.Component;

/**
 * 动态索引辅助类
 *
 * @author wangchlei
 * @date 2020/10/26
 */
@Component(value = "esConfig")
public class ElasticSearchConfiguration {

    private static final String API_CALL_INDEX_NAME_PREFIX = "scm_plan_sales_requirement_";

    public String getApiCallIndexName() {
        return API_CALL_INDEX_NAME_PREFIX + DateUtil.format(BigDataCacheUtil.startDate1, "yyyyMMdd");
    }

    public static String getIndex() {
        return API_CALL_INDEX_NAME_PREFIX + DateUtil.format(BigDataCacheUtil.startDate1, "yyyyMMdd");
    }
}
